import React, { Component,useState,useEffect } from 'react'
import request from "../untils/request"
import "../api/index"
const TestComponent = () => { 
  const [list, setList] = useState([])
  useEffect(() => {
    request.get("/api/list").then(res => {
      console.log("设置list");
      setList(res.data.list)
    })
  }, [])
  useEffect(() => {
    console.log("list变化");
  }, [list])
  useEffect(() => {
    return () => {
      console.log("销毁生命周期");
    }
  },[])
  return (
    <div>TestComponent</div>
  )
}

export default TestComponent
